package cscie160.project;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * Interface for an Automatic Telling Machine
 */
public interface ATM extends Remote
{
    /**
     * Deposit an amount of money into our account
     * @param accountInfo The account which is being manipulated, along with security credentials
     * @param amount  The amount to be deposited
     * @throws RemoteException Thrown if performing some unexpected operation
     */
    public void deposit(AccountInfo accountInfo, float amount) throws RemoteException;
    /**
     * Withdraw an amount of money from our account
     * @param accountInfo The account being manipulated, along with security credentials
     * @param amount  The amount to be withdrawn
     * @throws RemoteException Thrown if performing some unexpected operation
     */
	public void withdraw(AccountInfo accountInfo, float amount) throws RemoteException;
    /**
     * Returns the amount of money currently in the account
     * @param accountInfo The account being queried, along with security credentials
     * @return  Account balance
     * @throws RemoteException
     */
	public Float getBalance(AccountInfo accountInfo) throws RemoteException;

    /**
     * Transfers an amount of money from one account to another
     * @param fromAccount
     * @param toAccount
     * @param amount
     */
    public void transfer(AccountInfo fromAccount, AccountInfo toAccount, float amount) throws RemoteException;

    /**
     * Registers a new ATM listener, which will be notified any time transactions involving that listener
     * are conducted.
     * @param listener The listener being registered
     */
    public void addListener(ATMListener listener) throws RemoteException;
}